package grape.crm.rest.customer.form;
import grape.common.rest.form.BaseUpdateForm;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.ScriptAssert;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * <p>
 * 客户表
 * </p>
 *
 * @author yangwei
 * @since 2020-09-14
 */
@ScriptAssert(script = "!_this.categoryDictId || !_this.categoryDictCode",message = "客户分类不能为空",lang = "javascript",reportOn = "categoryDictId")

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="客户表更新表单对象")
public class CustomerUpdateForm extends BaseUpdateForm {

    private static final long serialVersionUID = 1L;

    @NotEmpty(message="客户编号不能为空")
    @ApiModelProperty(value = "客户编号，唯一",required = true)
    private String code;

    @NotEmpty(message=" 称呼不能为空")
    @ApiModelProperty(value = " 称呼",required = true)
    private String appellation;

    @ApiModelProperty(value = "姓名，真实姓名")
    private String name;

    @ApiModelProperty(value = "头像，图片绝对路径")
    private String avatar;

    @ApiModelProperty(value = "性别，字典id")
    private String genderDictId;

    @ApiModelProperty(value = "年龄")
    private Integer age;

    @ApiModelProperty(value = "出生年月日")
    private Date birthDay;

    @ApiModelProperty(value = "客户所在公司id")
    private String companyId;

    @ApiModelProperty(value = "客户所在部门id")
    private String departmentId;

}
